import Home from './components/Home'
import Menu from './components/Menu'
import About from './components/about/About'
import Admin from './components/Admin'
import Login from './components/Login'
import Register from './components/Register'

//二级路由
import History from './components/about/History'
import Contact from './components/about/Contact'
import OrderingGulde from './components/about/OrderingGulde'
import Delivery from './components/about/Delivery'

//三级路由
import PersonName from './components/about/contact/PersonName'
import Phone from './components/about/contact/Phone'

export const routes = [
	  {path:'/',name:'homeLink',components:{
	  	default:Home,
	  	'orderingGulde':OrderingGulde,
	  	'delivery':Delivery,
	  	'history':History
	  }},
	  {path:'/menu',name:'menuLink',component:Menu},
	  {path:'/about',name:'aboutLink',redirect:'/about/contact',component:About,children:[
	  	{path:'/about/history',name:'historyLink',component:History},
	  	{path:'/about/contact',name:'contactLink',redirect:'/personname',component:Contact,children:[
	  		{path:'/personname',name:'personName',component:PersonName},
	  		{path:'/phone',name:'phone',component:Phone}
	  	]},
	  	{path:'/about/orderingGulde',name:'orderingGuldeLink',component:OrderingGulde},
	  	{path:'/about/delivery',name:'deliveryLink',component:Delivery}
	  ]},
	  {path:'/admin',name:'adminLink',component:Admin,beforeEnter:(to,form,next)=>{
	  	alert("非登录状态，不能访问该页面")
	  }},
	  {path:'/login',name:'loginLink',component:Login},
	  {path:'/register',name:'registerLink',component:Register},
	  {path:'*',redirect:'/'}//找不到路径，跳转到指定路径
	]